package com.appleyk.controller;

import com.appleyk.result.ResponseMessage;
import com.appleyk.result.ResponseResult;
import com.appleyk.result.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.appleyk.service.QuestionService;

@RestController
@RequestMapping("/rest/appleyk/question")
public class QuestionController {

    @Autowired
    QuestionService questService;

    @RequestMapping("/query")
    public ResultData<String> query(@RequestParam(value = "question") String question) throws Exception {
        return new ResultData<String>(ResponseMessage.OK,questService.answer(question));
    }

}
